function [a,len,ret] = PriorityQueue_Delete(a,L)
%
ret=a(1);
a(1)=a(L);
a(L)=ret;
len = L-1;

a=heap_adjust(a,1,len);
